package com.finger.gulimall.order.service;

import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.finger.common.utils.PageUtils;
import com.finger.gulimall.order.entity.OrderEntity;
import com.finger.gulimall.order.entity.to.OrderTo;
import com.finger.gulimall.order.entity.vo.*;

/**
 * 订单
 *
 * @author finger
 * @email 909128695@qq.com
 * @date 2022-03-16 18:20:00
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 生成订单确认
     * @return OrderConfirmVo
     */
    OrderConfirmVo orderConfirmVo() throws Exception;


    /**
     * 计算运费
     * @param addrId
     * @return
     */
    AddrFareVo addrFare(Long addrId);

    /**
     * 提交订单
     * @param orderSubmitVo
     * @return
     */
    SubmitOrderRespVo submitOrder(OrderSubmitVo orderSubmitVo);

	OrderEntity getOrderByOrderSn(String orderSn);

    /**
     * 接受处理延迟队列延迟的消息
     * @param orderTo
     */
    void closeOrder(OrderTo orderTo);

    /**
     * 获取待支付的订单信息
     * @param payVo
     */
	void getPayOrder(PayVo payVo);


	IPage<OrderEntity> getOrderItems(Map<String, Object> params);

	/**
	 * 支付成功异步回调更新订单状态
	 * @param orderSn
	 * @param code
	 */
	void updateOrderStatus(String orderSn, Integer code);
}

